
import { baseUrl } from './config'
const token = wx.getStorageSync('token')
const uploadFile = (data) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: baseUrl + data.url,
      method: 'POST',
      header: {
        'Content-Type': data.header['Content-Type'],
        Authorization: token
      },
      data: data.data,
      success: (response) => {
        resolve(response.data)
      }
    })
  })
}
export default uploadFile
